package com.qs.entities;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Channel")
public class Channel implements Serializable{

	private static final long serialVersionUID = -4018730487257514038L;
	
	public Channel(){
		
	}
	
	public Channel(int id){
		this.channelId = id;
	}
	
	@Id
	@Column(name="channel_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer channelId;
	
	@Column(name="code")
	public String code;
	
	@Column(name="name")
	public String name;
	
	@Column(name="order_index")
	public Integer orderIndex;
	
	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "channels")
	public Set<User> users;
	
	@OneToMany(fetch = FetchType.LAZY)
	public Set<Feed> feeds;
}
